<template>
	<view class="content">
		<!-- <z-paging ref="paging" v-model="dataList" @query="getDataListAll" :show-loading-more-no-more-view="false"> -->
			<u-navbar title="提现审核" placeholder :autoBack="true" leftIconColor="#fff" bgColor="#000000"
					:titleStyle="titleStyle">
					
			</u-navbar>
			<view class="titleTv">提现明细(可提现金额{{ minemoney+'元' }})</view>
			
			<view class="itemVTo" v-for="(item,index) in list" :key="index">
				<view class="itemLeftV">
					<view class="itemTv1">{{item.status_text}}</view>
					<view class="itemTv2">{{item.createtime}}</view>
				</view>
				<view class="itemTv3">{{item.money}}</view>
			</view>

			<view class="bottomV">
				<view class="addOreder" @click="onSingClick()">申请提现</view>
			</view>
			<uni-popup ref="popup" type="bottom" background-color="#1F1F1F">
				<view class="popupBg">
					<view class="topV">
						<view class="srlV">
							<view class="typeV">
								<view class="typeTv">提现金额</view>
								<u--input class="phoneTv" color="#fff" placeholderStyle="color:#8d8d8d" fontSize="32rpx"
							placeholder="请输入提现金额" type="number" border="none" v-model="money"></u--input>
							</view>
						</view>
					</view>
					<view class="bottomVtwo">
						<view class="bt2" @click="onConfirmClick">确认提现</view>
					</view>
				</view>
			</uni-popup>
		<!-- </z-paging> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				titleStyle: {
					"color": "#ffffff"
				},
				dataList: [
					{memo:'标题',createtime:'2023-11-13',money:'100'}
				],
				info: {},
				mPage: 1,
				list: [],
				page: 1,
				limit: 10,
				last_page: 1,
				status: "loadmore",
				shop_id:'',
				money:'',
				minemoney:0
			}
		},
		onLoad(e) {
			this.shop_id = e.shop_id
			// this.info = JSON.parse(e.item);
			this.getList();
			console.log(this.dataList)
		},
		onReachBottom: function () {
			this.loadmore();
		},
		methods: {
			getList() {
				this.$api.getwithdrawList({
					page:this.page,
					shop_id:this.shop_id
				}).then((res) => {
					console.log(res)
					this.last_page = res.lastpage
					this.minemoney = res.money
					let list = res.list;
					this.list = this.page == 1 ? list : [...this.list, ...list];	
					if(this.page >= this.last_page){
					  this.status = 'nomore';
					}
				}).catch((e) => {})
			},
			loadmore() {
				let page = this.page;
				// let last_page = this.last_page;
				if (this.status == 'loadmore') {
					this.page++;
					this.getList();
				}
			},
			getDataListAll(pageNo, pageSize) {
				this.$api.getAccountLog({
					page:pageNo,
					shop_id:this.info.shop_id
				}).then((res) => {
					console.log(res)
					let resd = {}
					resd.list = this.dataList
					this.$refs.paging.complete(resd.list);
				}).catch((e) => {
					this.$refs.paging.complete(false);
				})
			},
			onRechargeClick() {
				this.$u.route({
					url: '/mine/me/OpenVip',
				})
			},
			onSingClick(){
				this.$refs.popup.open()
			},
			onClseClick() {
				this.$refs.popup.close()
			},
			onConfirmClick(){
				if(!this.money){
					uni.$u.toast("请输入申请金额")
					return;
				}
				this.$api.addWithdraw({
					shop_id:this.shop_id,
					money:this.money
				}).then((res) => {
					console.log(res)
					this.money =''
					uni.$u.toast("申请成功")
					this.onClseClick()
					this.page = 1
					this.getList();
				}).catch((e) => {
					console.log(e)
					this.money =''
					uni.$u.toast(e.msg)
					this.onClseClick()
					
					// this.$refs.paging.complete(false);
				})
			}
		}
	}
</script>

<style>
	.moneyV {
		margin: 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-left: 50rpx;
		padding-right: 50rpx;
		background-color: #1f1f1f;
		border-radius: 10rpx;
	}

	.moneyLeftV {
		height: 152rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.moneyTv1 {
		font-size: 32rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
	}
	.content{
		padding-bottom: 150rpx;
	}

	.moneyTv2 {
		font-size: 50rpx;
		font-family: PingFangSC-Semibold, PingFang SC;
		font-weight: 600;
		color: #CEF44F;
	}

	.moneyTv3 {
		height: 80rpx;
		background: #CEF44F;
		border-radius: 40rpx;
		font-size: 32rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #303B13;
		padding-left: 50rpx;
		padding-right: 50rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.titleTv {
		margin-top: 50rpx;
		font-size: 32rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #7E7E7E;
		margin-left: 30rpx;
		padding-bottom: 30rpx;
	}

	.itemV {
		height: 130rpx;
		margin-left: 30rpx;
		margin-right: 30rpx;
		padding-left: 30rpx;
		padding-right: 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		background-color: #111111;
	}

	.itemVTo {
		height: 130rpx;
		margin-left: 30rpx;
		margin-right: 30rpx;
		padding-left: 30rpx;
		padding-right: 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		background-color: #1f1f1f;
	}

	.itemLeftV {
		display: flex;
		flex-direction: column;
	}

	.itemTv1 {
		font-size: 32rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
	}

	.itemTv2 {
		font-size: 24rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #7E7E7E;
		margin-top: 10rpx;
	}

	.itemTv3 {
		font-size: 36rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #EA7979;
	}
	.bottomV {
		display: flex;
		height: 98rpx;
		align-items: center;
		z-index: 10;
		position: fixed;
		bottom: 0rpx;
		left: 0rpx;
		right: 0rpx;
		padding-left: 30rpx;
		padding-right: 30rpx;
		padding-bottom: 30rpx;

		
	}
	.addOreder {
			flex: 1;
			height: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			background-color: #CEF743;
			font-size: 32rpx;
			color: #333737;
			border-radius: 10rpx;
		}

		.addOrederTo {
			flex: 1;
			height: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			background-color: #3D3F3E;
			font-size: 32rpx;
			color: #8A8A8A;
			border-radius: 10rpx;
		}
		.bottomVtwo {
			display: flex;
			height: 98rpx;
			padding: 30rpx;

			
		}
		.bt2 {
				height: 100%;
				display: flex;
				align-items: center;
				justify-content: center;
				flex: 1;
				background: #CEF743;
				border-radius: 10rpx;
				color: #333333;
				font-size: 32rpx;
			}
			.typeV {
				display: flex;
				/* padding-left: 30rpx; */
				margin-top: 30rpx;
				padding: 30rpx 30rpx;

				
			}
			.typeTv {
				font-size: 32rpx;
				color: #E8E8E8;
				margin-right: 20rpx;
			}
</style>